package cn.anquing.shardingsphere.demo.service.impl;

import cn.anquing.shardingsphere.demo.entity.Order;
import cn.anquing.shardingsphere.demo.repository.OrderRepository;
import cn.anquing.shardingsphere.demo.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wangqq65
 * @since 2021/9/3 17:56
 */
@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderRepository orderRepository;

    @Override
    public Order getByOrderId(Long orderId) {
        return orderRepository.findByOrderId(orderId);
    }

    @Override
    public List<Order> listAll() {
        return orderRepository.findAll();
    }
}
